<template>
  <div>
    <div
      ref="skills"
      :class="className"
      :style="{ height: height, width: width }"
    ></div>
  </div>
</template>

<script>
var echarts = require("echarts");
require("echarts/theme/macarons"); // echarts theme
import resize from "@/views/dashboard/admin/components/mixins/resize";
export default {
  mixins: [resize],
  props: {
    className: {
      type: String,
      default: "chart",
    },
    width: {
      type: String,
      default: "100%",
    },
    height: {
      type: String,
      default: "300px",
    },
  },
  data() {
    return {
      chart: null,
    };
  },
  mounted() {
    this.$nextTick(() => {
      this.initChart();
    });
  },
  methods: {
    getVirtulData(year) {
      const data = [
        {
          value: [4200, 3000, 20000, 35000, 50000, 18000],
          name: "FFLOVE",
        },
        {
          value: [5000, 14000, 28000, 26000, 42000, 21000],
          name: "风离",
        },
      ];

      return data;
    },
    initChart() {
      const data = this.getVirtulData();
      this.chart = echarts.init(this.$refs.skills, "macarons");
      this.setOptions(data);
    },
    setOptions(data) {
      this.chart.setOption({
        // title: {
        //   text: "Basic Radar Chart",
        // },
        legend: {
          data: ["FFLOVE", "风离"],
          top:'20px',
            left:'5px',
          textStyle: {
            color: "#B9B8CE",
          
          }
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: "Sales", max: 6500 },
            { name: "Administration", max: 16000 },
            { name: "Information Technology", max: 30000 },
            { name: "Customer Support", max: 38000 },
            { name: "Development", max: 52000 },
            { name: "Marketing", max: 25000 },
          ],
        },
        series: [
          {
            name: "Budget vs spending",
            type: "radar",
            data: data
            
          },
        ],
      });
    },
  },
};
</script>

<style>
div{
   
}
</style>
